package com.auth.manager.security.auth;

import org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
import org.springframework.stereotype.Component;

/**
 * @version 1.0.0
 * @Date: 2022/4/28 16:08
 * @Author ZhuYouBin
 * @Description
 */
@Component
public class AuthSecurityInterceptor extends FilterSecurityInterceptor {

    /**
     * 这里通过构造方法, 将我们自定义的两个权限判断类注入到Spring Security里面
     * @param authMetaSource 获取权限资源
     * @param authDecisionManager 判断是否具有访问权限
     */
    public AuthSecurityInterceptor(AuthMetaSource authMetaSource, AuthDecisionManager authDecisionManager) {
        super.setSecurityMetadataSource(authMetaSource);
        super.setAccessDecisionManager(authDecisionManager);
    }

}
